Timo Sirainen [Thu, 26 Feb 2026 10:29:12 +0000 (12:29 +0200)]
[PATCH] lib: Preserve errno in our malloc() and free() wrappers
Various places assume that e.g. t_strdup_printf() calls and such don't
modify errno. But because they internally call malloc() or calloc(), this
isn't actually guaranteed now and it can happen at least with newer glibc
versions. Explicitly preserve the errno for these calls where it might
be a problem.
Gbp-Pq: Name lib_Preserve_errno_in_our_malloc_and_free_wrappers.patch
Noah Meyerhans [Thu, 5 Mar 2026 01:08:14 +0000 (20:08 -0500)]
[PATCH] Correctly handle signed 32-bit time_t types
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1124541
Forwarded: no
dovecot handles 32-bit time_t in a couple of different ways, but neither quite
works currently. Setting TIME_T_MAX_BITS to 31 isn't correctly handled in
places where time_t values are constructed, for example in
io_loop_get_wait_time().
Similarly, setting TIME_T_MAX_BITS = 32 and defining TIME_T_SIGNED is not
correctly handled by tm_is_too_large().
This change fixes tm_is_too_large() to set max_time to the correct maximum date
representable by a signed 32-bit time_t.
Closes: #1124541
Gbp-Pq: Name Correctly_handle_signed_32-bit_time_t_types.patch
Noah Meyerhans [Tue, 25 Nov 2025 21:38:42 +0000 (16:38 -0500)]
[PATCH] Work around test failure on big-endian architectures
Because the endianness of the target system results in data being
layed out differently in memory, the manually constructed test input
doesn't result in the expected failure modes, which is interpreted as
a test failure.
This is not a permanent fix. See
https://dovecot.org/mailman3/archives/list/dovecot@dovecot.org/message/FZBVU55TK5332SMZSSDNWIVJCWGUAJQS/
Gbp-Pq: Name work-around-test-failure-on-big-endian-architectures.patch
* [e8f1499] Drop stale build-dependency on libdb-dev (Closes: #1119173)
* [86b8fb2] lib: Preserve errno in our malloc() and free() wrappers
(Closes: #1128400)
* [99e1cd6] backport upstream fix for crash in trash plugin (Closes: #1127029)
Noah Meyerhans [Wed, 4 Feb 2026 16:09:21 +0000 (11:09 -0500)]
[PATCH] Correctly handle signed 32-bit time_t types
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1124541
Forwarded: no
dovecot handles 32-bit time_t in a couple of different ways, but neither quite
works currently. Setting TIME_T_MAX_BITS to 31 isn't correctly handled in
places where time_t values are constructed, for example in
io_loop_get_wait_time().
Similarly, setting TIME_T_MAX_BITS = 32 and defining TIME_T_SIGNED is not
correctly handled by tm_is_too_large().
This change fixes tm_is_too_large() to set max_time to the correct maximum date
representable by a signed 32-bit time_t.
Closes: #1124541
Gbp-Pq: Name Correctly_handle_signed_32-bit_time_t_types.patch
Noah Meyerhans [Tue, 25 Nov 2025 21:38:42 +0000 (16:38 -0500)]
[PATCH] Work around test failure on big-endian architectures
Because the endianness of the target system results in data being
layed out differently in memory, the manually constructed test input
doesn't result in the expected failure modes, which is interpreted as
a test failure.
This is not a permanent fix. See
https://dovecot.org/mailman3/archives/list/dovecot@dovecot.org/message/FZBVU55TK5332SMZSSDNWIVJCWGUAJQS/
Gbp-Pq: Name work-around-test-failure-on-big-endian-architectures.patch
Noah Meyerhans [Tue, 25 Nov 2025 21:38:42 +0000 (16:38 -0500)]
[PATCH] Work around test failure on big-endian architectures
Because the endianness of the target system results in data being
layed out differently in memory, the manually constructed test input
doesn't result in the expected failure modes, which is interpreted as
a test failure.
This is not a permanent fix. See
https://dovecot.org/mailman3/archives/list/dovecot@dovecot.org/message/FZBVU55TK5332SMZSSDNWIVJCWGUAJQS/
Gbp-Pq: Name work-around-test-failure-on-big-endian-architectures.patch
* [e34626c] import upstream fix for possible crash in ldap userdb
(Closes: #1121000)
* [8d95d15] d/control: add libpcre2-dev to build-deps (Closes: #1121193)
* [7b23f06] Work around test failure on big-endian architectures
Dovecot 2.4 introduced a regression that broke GSSAPI authentication for
some clients. This patch contains a fix provided by the upstream maintainers.
Last-Update: 2025-05-02
Gbp-Pq: Name bug1104549-gssapi-regression.patch
Dovecot 2.4 introduced a regression that broke GSSAPI authentication for
some clients. This patch contains a fix provided by the upstream maintainers.
Last-Update: 2025-05-02
Gbp-Pq: Name bug1104549-gssapi-regression.patch
Dovecot 2.4 introduced a regression that broke GSSAPI authentication for
some clients. This patch contains a fix provided by the upstream maintainers.
Last-Update: 2025-05-02
Gbp-Pq: Name bug1104549-gssapi-regression.patch
program-client.c:705:5: warning: conflicting types for 'program_client_run' due to enum/integer mismatch; have 'int(struct program_client *)' [-Wenum-int-mismatch]
705 | int program_client_run(struct program_client *pclient)
| ^~~~~~~~~~~~~~~~~~
In file included from program-client-private.h:4,
from program-client.c:17:
program-client.h:93:1: note: previous declaration of 'program_client_run' with type 'enum program_client_exit_status(struct program_client *)'
93 | program_client_run(struct program_client *pclient);
| ^~~~~~~~~~~~~~~~~~
db-lua.c:599:1: warning: conflicting types for 'auth_lua_call_password_verify' due to enum/integer mismatch; have 'enum passdb_result(struct dlua_script *, struct auth_request *, const char *, const char **)' [-Wenum-int-mismatch]
599 | auth_lua_call_password_verify(struct dlua_script *script,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from db-lua.c:28:
db-lua.h:14:5: note: previous declaration of 'auth_lua_call_password_verify' with type 'int(struct dlua_script *, struct auth_request *, const char *, const char **)'
14 | int auth_lua_call_password_verify(struct dlua_script *script,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The third argument to doveadm_cmd_param_bool() is only set on a return
value of TRUE.
Since disk_input_field and disk_output_field should be set if the value
of show-disk-io is specified and specified to true, fix the condition.
doveadm-oldstats.c: In function 'cmd_stats_top':
doveadm-oldstats.c:551:63: warning: 'b' may be used uninitialized [-Wmaybe-uninitialized]
551 | if (!doveadm_cmd_param_bool(cctx, "show-disk-io", &b) && b) {
| ^
doveadm-oldstats.c:545:14: note: 'b' was declared here
545 | bool b;
| ^
Gbp-Pq: Name Fix-uninitialized-read-in-doveadm-oldstats.patch
Timo Sirainen [Mon, 9 May 2022 12:23:33 +0000 (15:23 +0300)]
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter
The passdb was wrongly deduplicated in this situation, causing wrong
mechanisms or username_filter setting to be used. This would be a rather
unlikely configuration though.
Fixed by moving mechanisms and username_filter from struct passdb_module
to struct auth_passdb, which is where they should have been in the first
place.
Gbp-Pq: Name auth-Fix-handling-passdbs-with-identical-driver-args-but-.patch
master-service-settings-cache.c: In function 'master_service_settings_cache_init_filter':
master-service-settings-cache.c:94:3: warning: 'error' may be used uninitialized in this function [-Wmaybe-uninitialized]
94 | i_error("master-service: cannot get filters: %s", error);
| ^
master-service-settings-cache.c:89:14: note: 'error' was declared here
89 | const char *error;
| ^
Gbp-Pq: Name Silence-LTO-related-compiler-warning.patch
Helmut Grohne [Tue, 5 Jan 2021 21:25:00 +0000 (22:25 +0100)]
Improve cross-compile support
The check for the signedness of size_t really doesn't have to be run as
that is a compile time property.
Beyond that, dovecot uses mysql_config. I've looked into that and
mysql_config is unfixably broken during cross builds. It will not be
fixed. Instead, please use pkg-config. My patch implements that with a
fallback to mysql_config to avoid breaking other users.
Last but not least, src/lib-lua/Makefile.am adds $(LUA_LIBS) to
libdovecot_lua_la_DEPENDENCIES. As it happens, LUA_LIBS contains a -L
flag and when that flag shows up in a dependency, make gives up. I have
no clue why one would add LUA_LIBS to DEPENDENCIES as it already is
being correctly added to LIBADD. My patch suggests to quite simply drop
that.
sieve-binary.c: In function 'sieve_binary_get_resource_usage':
sieve-binary.c:199:54: warning: comparison of integer expressions of different signedness: 'time_t' {aka 'long int'} and 'unsigned int' [-Wsign-compare]
199 | if (update_time != 0 && (ioloop_time - update_time) > timeout)
| ^
This manual page uses the \' groff sequence. Usually, the intent to
generate an apostrophe, but that sequence actually renders as a an acute
accent.
For an apostrophe or a single closing quote, use plain '. For single
opening quote, i.e. a straight downward line ' like the one used in
shell commands, use \(aq.
Gbp-Pq: Name doveadm-director.1-drop-acute-accent.patch
Update Dovecot name to include Distribution in login greeting message
This patch was found at: https://blueprints.launchpad.net/ubuntu/+spec/servercloud-s-server-app-banner-updates
and originally provided by Ubuntu for their 2.1.7 package. The original
author is Yolanda Robla <yolanda.robla@canonical.com>. I updated it
for Debian's 2.2.5 package.